<template>
  <!-- 订单转派 -->
  <div class="order_content">
    <!-- aaaa -->
    <van-nav-bar title="订单转派" left-arrow @click-left="onClickLeft" />
    <van-tabs v-model="actives" color="#4D98FF" swipe-threshold="3" title-active-color="#4D98FF" @click="handleTab">
      <van-tab title="装机单转派" name="1"><order active="1" /></van-tab>
      <van-tab title="直派单转派" name="0"
        ><order active="0" />
      </van-tab>
    </van-tabs>
  </div>
</template>
      
<script>
import order from './order'
import store from '@/store/'
import { showZwtNav } from '@/utils/showNav.js'
const UA = window.navigator.userAgent.toLowerCase()

export default {
  name:'orderDispatch',
    components: { order },
  data() {
    return {
      actives: '1',
    }
  },


  mounted() {
    showZwtNav(this.$route.meta.title)
  },
  methods: {
    onClickLeft() {
      // this.$router.push({
      //   path: '/publicline/index',
      // })
      if (process.env.NODE_ENV == 'production') {
        const isZWT = UA && /ipumobile/.test(UA)
        if (isZWT) {
          window.WadeMobile && window.WadeMobile.closeH5()
          return
        }
        boncAppEngine.shutdown()
        this.$open('/publicline/index')
      } else {
        this.$open('/publicline/index')
      }
      store.commit('SET_ISACTIVE', null)

    },
    handleTab(name) {
      this.actives = name
      console.log("🚀 ~ handleTab ~ name:", name)
      store.commit('SET_ISACTIVE', null)
      store.commit('SET_SELECTORDER', null)
    },
  },
}
</script>
<style lang="less" scoped>
/deep/ .van-nav-bar {
  position: fixed;
  width: 100%;
}
/deep/ .van-tabs__wrap {
  position: fixed;
  width: 100%;
  margin-top: 46px;
  z-index: 9;
}
/deep/ .van-nav-bar__content {
  background: linear-gradient(134deg, #80d9f9 0%, #5466fa 100%);
}
/deep/ .van-nav-bar__title {
  font-size: 18px;
  color: #ffffff;
  letter-spacing: -0.6px;
  text-align: center;
}
/deep/ .van-nav-bar .van-icon {
  color: #fff;
  font-size: 20px;
}
/deep/ .van-tabs__line {
  width: 20px;
  margin-bottom: 3px;
}
/deep/ .van-tabs__nav--line {
  margin-bottom: 10px;
}
/deep/ .van-tab__text {
  font-size: 15px;
  color: #333333;
  letter-spacing: -0.53px;
}
</style>